package com.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.controller.Action;
import com.dao.MemberDao;
import com.domain.Member;

public class InputProAction implements Action {

	@Override
	public String execute(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		
		request.setCharacterEncoding("euc-kr");
		Member member= new Member();
		
		member.setId(request.getParameter("id"));
		member.setName(request.getParameter("name"));
		member.setPasswd(request.getParameter("passwd"));
		member.setEmail(request.getParameter("email"));
		member.setEmail_domain(request.getParameter("email_domain"));

		member.setBirthM(request.getParameter("birthM"));
		member.setBirthD(request.getParameter("birthD"));
		member.setBirthY(request.getParameter("birthY"+"birthM"));
		member.setSex(request.getParameter("sex"));
		member.setPhone1(request.getParameter("phone1"));
		member.setPhone2(request.getParameter("phone2"));
		member.setPhone3(request.getParameter("phone3"));
	
		member.setAddress(request.getParameter("address"));
	
		MemberDao dao = MemberDao.getInstance();
		dao.insertMember(member);
		
		return "/view/inputPro.jsp";
	}

}
